package util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {

	private static final SessionFactory SESSIONFA_FACTORY;
	private static final Session SESSION;

	static {
		SESSIONFA_FACTORY = new AnnotationConfiguration().configure()
				.buildSessionFactory();

		SESSION = SESSIONFA_FACTORY.openSession();

	}

	public static SessionFactory getSessionFactory() {
		return SESSIONFA_FACTORY;
	}

	public static Session getSession() {
		return SESSION;
	}

}
